﻿using Wolfpack.Core;
using Wolfpack.Core.Interfaces;

namespace Wolfpack.Contrib.Publishers.MongoDb
{
    public class MongoDbPublisherBootstrapper : ISupportBootStrapping<MongoDbConfiguration>
    {
        public void Execute(MongoDbConfiguration config)
        {
            if (!config.Enabled)
                return;

            if (config.UseAsRepository)
            {
                var repository = new MongoDbRepository(config);
                Container.RegisterInstance<INotificationRepository>(repository);
            }
        }
    }
}